package com.funever.fragment;

import com.funever.activity.AddTypeActivity;
import com.funever.activity.MainActivity;
import com.funever.activity.TypeListActivity;
import com.funever.combworkalerm.R;

import net.tsz.afinal.annotation.view.ViewInject;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

public class MenuFragment extends BaseFragment {
	
	@ViewInject(id=R.id.add_type,click="onClick")
	TextView add_type;
	@ViewInject(id=R.id.type_list,click="onClick")
	TextView type_list;
	@ViewInject(id=R.id.type_review,click="onClick")
	TextView type_review;
	@ViewInject(id=R.id.ten_days,click="onClick")
	TextView ten_days;
	
	MainActivity mainActivity;
	
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		mainView = inflater.inflate(R.layout.menu_list, null);
		return mainView;
	}
	
	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
	}
	
	public void onClick(View v){
		mainActivity = (MainActivity) getActivity();
		if(v == add_type){
			mainActivity.switchFragment(new AddTypeActivity());
		}else if(v == type_list){
			mainActivity.switchFragment(new TypeListActivity());
		}else if(v == type_review){
			mainActivity.switchFragment(new TypeReviewFragment());
		}else if(v == ten_days){
			mainActivity.switchFragment(new TenDaysTypeFragment());
		}
	}
}
